<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>冒泡排序</title>
</head>
<body>
    <p>选做：自己研究快速排序法。</p>
    <script>
        let a = [3123,4312,243,53,45,457,5,67,5,23,4,345,23,4,6,213,4,123,465765,563,43,1243,123123];

        // 趟数
        for (let i = 1;i <= a.length - 1 ;i ++) {
            // 每趟次数
            for (let j = 0; j < a.length - i;j ++) {
                if (a[j] > a[j + 1]) {
                    let t = a[j];
                    a[j] = a[j + 1];
                    a[j + 1] = t;
                }
            }
        }
        console.log(a);
    </script>
</body>
</html>